Method and apparatus for controlling coding tools

ABSTRACT

A method and device for controlling coding tools are provided. The video decoding method includes decoding, from a high level of a bitstream, an enable flag indicating whether one or more coding tools are enabled. The coding tools includes a first coding tool that encodes sample values using luma component mapping based on a piecewise linear model. The method includes acquiring a value of an application flag depending on a value of the enable flag, by setting the application flag indicating whether to apply the coding tools to a predetermined value, or by decoding the application flag from a low level of the bitstream, the application flag including a first application flag indicating whether to apply the first coding tool. The coding tools are operated when the value of the application flag is a value indicating that the coding tools are applied.

CROSS-REFERENCE TO RELATED APPLICATION

This application claims priority to Korean Patent Application No.10-2019-0074231 filed on Jun. 21, 2019, Korean Patent Application No.10-2019-0079652 filed on Jul. 2, 2019, and Korean Patent Application No.10-2020-0075560 filed on Jun. 22, 2020, which are incorporated herein byreference in their entirety.

TECHNICAL FIELD

The present disclosure relates to encoding and decoding of a video, andmore particularly, to a method and apparatus for improving theefficiency of encoding and decoding by organically controlling variouscoding tools for encoding and decoding of a video.

BACKGROUND ART

Since the volume of video data is larger than that of voice data orstill image data, storing or transmitting video data without processingfor compression requires a lot of hardware resources including memory.Accordingly, in storing or transmitting video data, the video data isgenerally compressed using an encoder to be stored or transmitted. Then,a decoder receives the compressed video data, and decompresses andreproduces the video data. Compression techniques for such video includeH.264/AVC and High Efficiency Video Coding (HEVC), which improves codingefficiency over H.264/AVC by about 40%.

However, the video size, resolution, and frame rate are graduallyincreasing, and accordingly the amount of data to be encoded is alsoincreasing. Accordingly, a new compression technique having betterencoding efficiency and higher image quality than the existingcompression technique is required.

SUMMARY

In order to meet these needs, the present disclosure aims to provide animproved video encoding and decoding technology. In particular, oneaspect of the present disclosure relates to a technique for improvingthe efficiency of encoding and decoding by controlling On or Off ofvarious coding tools through a syntax element defined at a high level.

In accordance with one aspect of the present disclosure, provided is avideo decoding method including decoding, from a high level of abitstream, an enable flag indicating whether one or more coding toolsare enabled, the one or more coding tools comprising a first coding toolconfigured to encode sample values using luma component mapping based ona piecewise linear model; acquiring a value of an application flagdepending on a value of the enable flag, by setting the application flagindicating whether to apply the one or more coding tools to apredetermined value or by decoding the application flag from a low levelof the bitstream, the application flag comprising a first applicationflag indicating whether to apply the first coding tool; and when thevalue of the application flag is a value indicating that the one or morecoding tools are applied, executing the one or more coding tools.

When the first coding tool is executed according to a value of the firstapplication flag, the executing of the one or more coding toolsincludes: generating a mapped luma prediction sample from a lumaprediction sample based on a piecewise linear model corresponding to theluma prediction sample, and generating a luma reconstructed sample byadding a luma residual sample reconstructed from the bitstream and themapped luma prediction sample; and reversely mapping the lumareconstructed sample using an inverse piecewise linear model having aninverse relationship with the piecewise linear model.

In accordance with another aspect of the present disclosure, provided isa video decoding apparatus including an entropy decoder configured todecode, from a high level of a bitstream, an enable flag indicatingwhether one or more coding tools are enabled, the one or more codingtools including a first coding tool configured to encode a sample valueusing luma component mapping based on a piecewise linear model; anacquisition unit configured to acquire a value of an application flagindicating whether to apply the one or more coding tools, by, accordingto a value of the enable flag, setting the application flag to apredetermined value or decoding the same from a low level of thebitstream, wherein the application flag includes a first applicationflag indicating whether to apply the first coding tool; and an executionunit configured to execute the one or more coding tools when the valueof the application flag is a value indicating that the one or morecoding tools are applied.

When the first coding tool is executed according to a value of the firstapplication flag, the execution unit configured to: generate a mappedluma prediction sample from a luma prediction sample based on apiecewise linear model corresponding to the luma prediction sample;generate a luma reconstructed sample by adding a luma residual samplereconstructed from the bitstream and the mapped luma prediction sample;and reversely map the luma reconstructed sample using an inversepiecewise linear model having an inverse relationship with the piecewiselinear model.

As is apparent from the foregoing, according to an exemplary embodimentof the present disclosure, whether to apply various coding tools may becontrolled at a high level, and therefore compression performance inencoding and decoding may be improved.

DESCRIPTION OF DRAWINGS

FIG. 1 is an exemplary block diagram of a video encoding apparatuscapable of implementing the techniques of the present disclosure.

FIG. 2 exemplarily shows block partitioning structure using a QTBTTTstructure.

FIG. 3A exemplarily shows a plurality of intra-prediction modes.

FIG. 3B exemplarily shows a plurality of intra prediction modesincluding wide-angle intra prediction modes.

FIG. 4 is an exemplary block diagram of a video decoding apparatuscapable of implementing the techniques of the present disclosure.

FIG. 5 is an exemplary block diagram of a video decoding apparatuscapable of controlling coding tools.

FIG. 6 is a flowchart illustrating an example of a method of controllingcoding tools.

FIGS. 7 and 8 are flowcharts illustrating various examples of a methodof controlling coding tools.

FIG. 9 is an exemplary block diagram illustrating a first coding tool.

FIG. 10 is an exemplary block diagram of a video decoding apparatuscapable of performing a first coding tool.

FIG. 11 is a flowchart illustrating an example of a method ofcontrolling execution of a first coding tool is.

FIG. 12 is a flowchart illustrating an example of a method of deriving amapped luma prediction sample by a first coding tool.

FIG. 13 is a flowchart illustrating an example of a method of deriving ascaling factor by a first coding tool.

FIG. 14 is a flowchart illustrating an example of a method of derivingan reversely mapped luma reconstruction sample by the first coding tool.

FIG. 15 is a flowchart illustrating an example of a method ofdetermining whether to scale chroma residual samples by the first codingtool.

FIG. 16 is a flowchart illustrating an example of a method of scalingchroma residual samples by the first coding tool.

FIG. 17 is a flowchart illustrating an example of a method ofcontrolling execution of a second coding tool.

DETAILED DESCRIPTION

Hereinafter, some embodiments of the present disclosure will bedescribed in detail with reference to the accompanying drawings. Itshould be noted that, in adding reference numerals to the constituentelements in the respective drawings, like reference numerals designatelike elements, although the elements are shown in different drawings.Further, in the following description of the present disclosure, adetailed description of known functions and configurations incorporatedherein will be omitted to avoid obscuring the subject matter of thepresent disclosure.

FIG. 1 is an exemplary block diagram of a video encoding apparatuscapable of implementing the techniques of the present disclosure.Hereinafter, a video encoding apparatus and elements of the apparatuswill be described with reference to FIG. 1.

The video encoding apparatus may include a picture splitter 110, apredictor 120, a subtractor 130, a transformer 140, a quantizer 145, arearrangement unit 150, an entropy encoder 155, an inverse quantizer160, an inverse transformer 165, an adder 170, a filter unit 180, and amemory 190. Each element of the video encoding apparatus may beimplemented in hardware or software, or a combination of hardware andsoftware. The functions of the respective elements may be implemented assoftware, and a microprocessor may be implemented to execute thesoftware functions corresponding to the respective elements.

One video includes a plurality of pictures. Each picture is split into aplurality of regions, and encoding is performed on each region. Forexample, one picture is split into one or more tiles or/and slices. Inparticular, the one or more tiles may be defined as a tile group. Eachtile or slice is split into one or more coding tree units (CTUs). EachCTU is split into one or more coding units (CUs) by a tree structure.Information applied to each CU is encoded as a syntax of the CU, andinformation applied to CUs included in one CTU in common is encoded as asyntax of the CTU. In addition, information applied to all blocks in oneslice in common is encoded as a syntax of a slice header, andinformation applied to all blocks constituting a picture is encoded in apicture parameter set (PPS) or a picture header. Furthermore,information which a plurality of pictures refers to in common is encodedin a sequence parameter set (SPS). In addition, information referred toby one or more SPSs in common is encoded in a video parameter set (VPS).Information applied to one tile or tile group in common may be encodedas a syntax of a tile or tile group header.

The picture splitter 110 is configured to determine the size of a codingtree unit (CTU). Information about the size of the CTU (CTU size) isencoded as a syntax of the SPS or PPS and is transmitted to the videodecoding apparatus. The picture splitter 110 is configured to split eachpicture constituting the video into a plurality of CTUs having apredetermined size, and then recursively split the CTUs using a treestructure. In the tree structure, a leaf node serves as a coding unit(CU), which is a basic unit of coding.

The tree structure may be a QuadTree (QT), in which a node (or parentnode) is split into four sub-nodes (or child nodes) of the same size, aBinaryTree (BT), in which a node is split into two sub-nodes, aTernaryTree (TT), in which a node is split into three sub-nodes having aratio of 1:2:1, or a structure formed by a combination of two or more ofthe QT structure, the BT structure, and the TT structure. For example, aQuadTree plus BinaryTree (QTBT) structure may be used, or a QuadTreeplus BinaryTree TernaryTree (QTBTTT) structure may be used. Inparticular, BTTT may be collectively referred to as a multiple-type tree(MTT).

FIG. 2 exemplarily shows a QTBTTT splitting tree structure. As shown inFIG. 2, a CTU may be initially split in the QT structure. The QTsplitting may be repeated until the size of the splitting block reachesthe minimum block size MinQTSize of a leaf node allowed in the QT. Afirst flag (QT_split_flag) indicating whether each node of the QTstructure is split into four nodes of a lower layer is encoded by theentropy encoder 155 and signaled to the video decoding apparatus.

When the leaf node of the QT is equal to or less than the maximum blocksize (MaxBTSize) of the root node allowed in the BT, it may be furthersplit into one or more of the BT structure or the TT structure. The BTstructure and/or the TT structure may have a plurality of splittingdirections. For example, there may be two directions, namely, adirection in which a block of a node is horizontally split and adirection in which the block is vertically split. As shown in FIG. 2,when MTT splitting is started, a second flag (mtt_split_flag) indicatingwhether nodes are split, a flag indicating a splitting direction(vertical or horizontal) in the case of splitting, and/or a flagindicating a splitting type (Binary or Ternary) are encoded by theentropy encoder 155 and signaled to the video decoding apparatus.

Alternatively, prior to encoding the first flag (QT_split_flag)indicating whether each node is split into 4 nodes of a lower layer, aCU splitting flag (split_cu_flag) indicating whether the node is splitmay be encoded. When the value of the CU split flag (split_cu_flag)indicates that splitting is not performed, the block of the node becomesa leaf node in the splitting tree structure and serves a coding unit(CU), which is a basic unit of encoding. When the value of the CU splitflag (split_cu_flag) indicates that splitting is performed, the videoencoding apparatus starts encoding the flags in the manner describedabove, starting with the first flag.

When QTBT is used as another example of a tree structure, there may betwo splitting types, which are a type of horizontally splitting a blockinto two blocks of the same size (i.e., symmetric horizontal splitting)and a type of vertically splitting a block into two blocks of the samesize (i.e., symmetric vertical splitting). A split flag (split_flag)indicating whether each node of the BT structure is split into block ofa lower layer and splitting type information indicating the splittingtype are encoded by the entropy encoder 155 and transmitted to the videodecoding apparatus. There may be an additional type of splitting a blockof a node into two asymmetric blocks. The asymmetric splitting type mayinclude a type of splitting a block into two rectangular blocks at asize ratio of 1:3, or a type of diagonally splitting a block of a node.

CUs may have various sizes according to QTBT or QTBTTT splitting of aCTU. Hereinafter, a block corresponding to a CU (i.e., a leaf node ofQTBTTT) to be encoded or decoded is referred to as a “current block.” AsQTBTTT splitting is employed, the shape of the current block may besquare or rectangular. The predictor 120 is configured to predict thecurrent block to generate a prediction block. The predictor 120 includesan intra-predictor 122 and an inter-predictor 124.

In general, each of the current blocks in a picture may be predictivelycoded. In addition, prediction of a current block is performed using anintra-prediction technique (using data from a picture containing thecurrent block) or an inter-prediction technique (using data from apicture coded before a picture containing the current block). Theinter-prediction includes both unidirectional prediction andbi-directional prediction.

The intra-prediction unit 122 is configured to predict pixels in thecurrent block using pixels (reference pixels) positioned around thecurrent block in the current picture including the current block. Thereare a plurality of intra-prediction modes according to the predictiondirections. For example, as shown in FIG. 3A, the plurality ofintra-prediction modes may include two non-directional modes, whichinclude a planar mode and a direct current (DC) mode, and 65 directionalmodes. Neighboring pixels and an equation to be used are defineddifferently for each prediction mode. The table below listsintra-prediction mode numbers and names thereof.

For efficient directional prediction for a rectangular-shaped currentblock, directional modes (intra-prediction modes 67 to 80 and −1 to −14)indicated by dotted arrows in FIG. 3B may be additionally used. Thesemodes may be referred to as “wide angle intra-prediction modes.” In FIG.3B, arrows indicate corresponding reference samples used for prediction,not indicating prediction directions. The prediction direction isopposite to the direction indicated by an arrow. A wide-angle intraprediction mode is a mode in which prediction is performed in adirection opposite to a specific directional mode without additional bittransmission when the current block has a rectangular shape.

In particular, among the wide angle intra-prediction modes, some wideangle intra-prediction modes available for the current block may bedetermined based on a ratio of the width and height of the rectangularcurrent block. For example, wide angle intra-prediction modes with anangle less than about 45 degrees (intra prediction modes 67 to 80) maybe used when the current block has a rectangular shape with a heightless than the width thereof. Wide angle intra-prediction modes with anangle greater than about −135 degrees (intra-prediction modes −1 to −14)may be used when the current block has a rectangular shape with heightgreater than the width thereof.

The intra-predictor 122 may be configured to determine anintra-prediction mode to be used in encoding the current block. In someexamples, the intra-predictor 122 may be configured to encode thecurrent block using several intra-prediction modes and select anappropriate intra-prediction mode to use from the tested modes. Forexample, the intra-predictor 122 may be configured to calculate ratedistortion values using rate-distortion analysis of several testedintra-prediction modes, and select an intra-prediction mode that has thebest rate distortion characteristics among the tested modes.

The intra-predictor 122 is configured to select one intra-predictionmode from among the plurality of intra-prediction modes, and predict thecurrent block using neighboring pixels (reference pixels) and anequation determined according to the selected intra-prediction mode.Information about the selected intra-prediction mode is encoded by theentropy encoder 155 and transmitted to the video decoding apparatus.

The inter-predictor 124 is configured to generate a prediction block forthe current block through motion compensation. The inter-predictor 124is configured to search for a block most similar to the current block ina reference picture which has been encoded and decoded earlier than thecurrent picture, and generate a prediction block for the current blockusing the searched block. Then, the inter-predictor is configured togenerate a motion vector corresponding to a displacement between thecurrent block in the current picture and the prediction block in thereference picture. In general, motion estimation is performed on a lumacomponent, and a motion vector calculated based on the luma component isused for both the luma component and the chroma component. The motioninformation including information about the reference picture andinformation about the motion vector used to predict the current block isencoded by the entropy encoder 155 and transmitted to the video decodingapparatus.

The subtractor 130 is configured to subtract the prediction blockgenerated by the intra-predictor 122 or the inter-predictor 124 from thecurrent block to generate a residual block. The transformer 140 may beconfigured to split the residual block into one or more transformblocks, and apply the transformation to the one or more transformblocks, thereby transforming the residual values of the transform blocksfrom the pixel domain to the frequency domain. In the frequency domain,the transformed blocks are referred to as coefficient blocks containingone or more transform coefficient values. A two-dimensional transformkernel may be used for transformation, and one-dimensional transformkernels may be used for horizontal transformation and verticaltransformation, respectively. The transform kernels may be based on adiscrete cosine transform (DCT), a discrete sine transform (DST), or thelike.

The transformer 140 may be configured to transform residual signals inthe residual block using the entire size of the residual block as atransformation unit. In addition, the transformer 140 may be configuredto partition the residual block into two sub-blocks in a horizontal orvertical direction, and transform only one of the two sub-blocks.Accordingly, the size of the transform block may be different from thesize of the residual block (and thus the size of the prediction block).Non-zero residual sample values may not be present or may be very rarein the untransformed subblock. The residual samples of the untransformedsubblock are not signaled, and may be regarded as “0” by the videodecoding apparatus. There may be multiple partition types according tothe partitioning direction and partitioning ratio.

The transformer 140 may be configured to provide information about thecoding mode (or transform mode) of the residual block (e.g., informationindicating whether the residual block is transformed or the residualsubblock is transformed, and information indicating the partition typeselected to partition the residual block into subblocks, and informationidentifying a subblock that is transformed is performed) to the entropyencoder 155. The entropy encoder 155 may be configured to encode theinformation about the coding mode (or transform mode) of the residualblock. The quantizer 145 may be configured to quantize transformcoefficients output from the transformer 140, and output the quantizedtransform coefficients to the entropy encoder 155. For some blocks orframes, the quantizer 145 may be configured to directly quantize arelated residual block without transformation.

The rearrangement unit 150 may be configured to rearrange thecoefficient values for the quantized residual value. Additionally, therearrangement unit 150 may be configured to change the 2-dimensionalarray of coefficients into a 1-dimensional coefficient sequence throughcoefficient scanning. For example, the rearrangement unit 150 may beconfigured to scan coefficients from a DC coefficient to a coefficientin a high frequency region using a zig-zag scan or a diagonal scan tooutput a 1-dimensional coefficient sequence. Depending on the size ofthe transformation unit and the intra-prediction mode, a vertical scan,in which a two-dimensional array of coefficients is scanned in a columndirection, or a horizontal scan, in which two-dimensional block-shapedcoefficients are scanned in a row direction, may be used instead of thezig-zag scan. In other words, a scan mode to be used may be determinedamong the zig-zag scan, the diagonal scan, the vertical scan and thehorizontal scan according to the size of the transformation unit and theintra-prediction mode.

The entropy encoder 155 is configured to encode the one-dimensionalquantized transform coefficients output from the rearrangement unit 150using uses various encoding techniques such as Context-based AdaptiveBinary Arithmetic Code (CABAC) and exponential Golomb, to generate abitstream. The entropy encoder 155 is configured to encode informationsuch as a CTU size, a CU split flag, a QT split flag, an MTT splittingtype, and an MTT splitting direction, which are associated with blocksplitting, such that the video decoding apparatus may split the block inthe same manner as in the video encoding apparatus. In addition, theentropy encoder 155 is configured to encode information about aprediction type indicating whether the current block is encoded byintra-prediction or inter-prediction, and encode intra-predictioninformation (i.e., information about an intra-prediction mode) orinter-prediction information (information about a reference pictureindex and a motion vector) according to the prediction type.

The inverse quantizer 160 may be configured to inversely quantize thequantized transform coefficients output from the quantizer 145 togenerate transform coefficients. The inverse transformer 165 isconfigured to transform the transform coefficients output from theinverse quantizer 160 from the frequency domain to the spatial domainand reconstruct the residual block. The adder 170 is configured to addthe reconstructed residual block to the prediction block generated bythe predictor 120 to reconstruct the current block. The pixels in thereconstructed current block are used as reference pixels in performingintra-prediction of a next block.

The filter unit 180 is configured to filter the reconstructed pixels toreduce blocking artifacts, ringing artifacts, and blurring artifactsgenerated due to block-based prediction and transformation/quantization.The filter unit 180 may include a deblocking filter 182 and a pixeladaptive offset (SAO) filter 184. The deblocking filter 180 isconfigured to filter the boundary between the reconstructed blocks toremove blocking artifacts caused by block-by-block coding/decoding, andthe SAO filter 184 is configured to perform additional filtering on thedeblocking-filtered video. The SAO filter 184 is a filter used tocompensate for a difference between a reconstructed pixel and anoriginal pixel caused by lossy coding.

The reconstructed blocks filtered through the deblocking filter 182 andthe SAO filter 184 are stored in the memory 190. Once all blocks in onepicture are reconstructed, the reconstructed picture may be used as areference picture for inter-prediction of blocks in a picture to beencoded next.

FIG. 4 is an exemplary functional block diagram of a video decodingapparatus capable of implementing the techniques of the presentdisclosure. Hereinafter, the video decoding apparatus and elements ofthe apparatus will be described with reference to FIG. 4.

The video decoding apparatus may include an entropy decoder 410, arearrangement unit 415, an inverse quantizer 420, an inverse transformer430, a predictor 440, an adder 450, a filter unit 460, and a memory 470.Similar to the video encoding apparatus of FIG. 1, each element of thevideo decoding apparatus may be implemented in hardware, software, or acombination of hardware and software. Further, the function of eachelement may be implemented in software, and the microprocessor may beimplemented to execute the function of software corresponding to eachelement.

The entropy decoder 410 is configured to determine a current block to bedecoded by decoding a bitstream generated by the video encodingapparatus and extracting information related to block splitting, andextract prediction information and information about a residual signal,and the like required to reconstruct the current block. The entropydecoder 410 is configured to extract information about the CTU size fromthe sequence parameter set (SPS) or the picture parameter set (PPS),determine the size of the CTU, and split a picture into CTUs of thedetermined size. Then, the decoder is configured to determine the CTU asthe uppermost layer, that is, the root node of a tree structure, andextract splitting information about the CTU to split the CTU using thetree structure.

For example, when the CTU is split using a QTBTTT structure, a firstflag (QT_split_flag) related to splitting of the QT is extracted tosplit each node into four nodes of a sub-layer. For a node correspondingto the leaf node of the QT, the second flag (MTT_split_flag) andinformation about a splitting direction (vertical/horizontal) and/or asplitting type (binary/ternary) related to the splitting of the MTT areextracted to split the corresponding leaf node in the MTT structure.Thereby, each node below the leaf node of QT is recursively split in aBT or TT structure.

As another example, when a CTU is split using the QTBTTT structure, a CUsplit flag (split_cu_flag) indicating whether to split a CU may beextracted. When the corresponding block is split, the first flag(QT_split_flag) may be extracted. In the splitting operation, zero ormore recursive MTT splitting may occur for each node after zero or morerecursive QT splitting. For example, the CTU may directly undergo MTTsplitting without the QT splitting, or undergo only QT splittingmultiple times. As another example, when the CTU is split using the QTBTstructure, the first flag (QT_split_flag) related to QT splitting isextracted, and each node is split into four nodes of a lower layer.Then, a split flag (split_flag) indicating whether a node correspondingto a leaf node of QT is further split in the BT and the splittingdirection information are extracted.

Once the current block to be decoded is determined through splitting inthe tree structure, the entropy decoder 410 is configured to extractinformation about a prediction type indicating whether the current blockis intra-predicted or inter-predicted. When the prediction typeinformation indicates intra-prediction, the entropy decoder 410 isconfigured to extract a syntax element for the intra-predictioninformation (intra-prediction mode) for the current block. When theprediction type information indicates inter-prediction, the entropydecoder 410 is configured to extract a syntax element for theinter-prediction information, that is, information indicating a motionvector and a reference picture referred to by the motion vector.

The entropy decoder 410 is configured to extract information about thecoding mode of the residual block (e.g., information about whether theresidual block is encoded only a subblock of the residual block isencoded, information indicating the partition type selected to partitionthe residual block into subblocks, information identifying the encodedresidual subblock, quantization parameters, etc.) from the bitstream.The entropy decoder 410 is also configured to extract information aboutquantized transform coefficients of the current block as informationabout the residual signal.

The rearrangement unit 415 may be configured to change the sequence ofthe one-dimensional quantized transform coefficients entropy-decoded bythe entropy decoder 410 to a 2-dimensional coefficient array (i.e.,block) in a reverse order of the coefficient scanning performed by thevideo encoding apparatus. The inverse quantizer 420 is configured toinversely quantize the quantized transform coefficients. The inversetransformer 430 is configured to inversely transform the inverselyquantized transform coefficients from the frequency domain to thespatial domain based on information about the coding mode of theresidual block to reconstruct residual signals, thereby generating areconstructed residual block for the current block

When the information about the coding mode of the residual blockindicates that the residual block of the current block has been coded bythe video encoding apparatus, the inverse transformer 430 uses the sizeof the current block (and thus the size of the residual block to bereconstructed) as a transform unit for the inverse quantized transformcoefficients to perform inverse transform to generate a reconstructedresidual block for the current block.

When the information about the coding mode of the residual blockindicates that only one subblock of the residual block has been coded bythe video encoding apparatus, the inverse transformer 430 uses the sizeof the transformed subblock as a transform unit for the inversequantized transform coefficients to perform inverse transform toreconstruct the residual signals for the transformed subblock, and fillsthe residual signals for the untransformed subblock with a value of “0”to generate a reconstructed residual block for the current block.

The predictor 440 may include an intra-predictor 442 and aninter-predictor 444. The intra-predictor 442 is activated when theprediction type of the current block is intra-prediction, and theinter-predictor 444 is activated when the prediction type of the currentblock is inter-prediction. The intra-predictor 442 is configured todetermine an intra-prediction mode of the current block among aplurality of intra-prediction modes based on the syntax element for theintra-prediction mode extracted from the entropy decoder 410, andpredict the current block using the reference pixels around the currentblock according to the intra-prediction mode.

The inter-predictor 444 is configured to determine a motion vector ofthe current block and a reference picture referred to by the motionvector using the syntax element for the intra-prediction mode extractedfrom the entropy decoder 410, and predict the current block based on themotion vector and the reference picture. The adder 450 is configured toreconstruct the current block by adding the residual block output fromthe inverse transformer 430 and the prediction block output from theinter-predictor 444 or the intra-predictor 442. The pixels in thereconstructed current block are used as reference pixels inintra-predicting a block to be decoded next.

The filter unit 460 may include a deblocking filter 462 and an SAOfilter 464. The deblocking filter 462 deblocking-filters the boundarybetween the reconstructed blocks to remove blocking artifacts caused byblock-by-block decoding. The SAO filter 464 is configured to performadditional filtering on the reconstructed block after deblockingfiltering to corresponding offsets to compensate for a differencebetween the reconstructed pixel and the original pixel caused by lossycoding. The reconstructed block filtered through the deblocking filter462 and the SAO filter 464 is stored in the memory 470. When all blocksin one picture are reconstructed, the reconstructed picture is used as areference picture for inter-prediction of blocks in a picture to beencoded next.

In the present disclosure, a method of controlling various coding tools(i.e., coding tool control methods) is proposed. The coding toolsoperated according to the method of the present disclosure may include acoding tool configured to skip a transform/inverse transform operationfor residual samples, a coding tool configured to selectively apply oneor more of various transform kernels to residual samples to which atransform operation is applied, a coding tool configured to acquireprediction information for a current block from another block located ina current picture containing the current block, a coding tool (a firstcoding tool) configured to map prediction samples and scale residualsamples using a piece-wise linear model, and a coding tool (a secondcoding tool) configured to apply differential coding to residualsamples.

Hereinafter, coding tools operated according to the method of thepresent disclosure will be referred to as “target coding tools.” Thetarget coding tools may correspond to coding tools for screen contentcoding (SCC). Operating a target coding tool may refer toenabling/disabling the target coding tool. In addition, operating thetarget coding tool may refer to turning on or off the target codingtool. The operation of the target coding tool may be performed on everycombination or group of one or more coding tools included in the targetcoding tool.

Whether to enable/disable a target coding tool and whether to turnon/off the same may be controlled using an enable flag defined at a highlevel of a bitstream. The enable flag may indicate whether to enable thetarget coding tool, or may indicate whether SCC is applied to a targetimage to be encoded/decode. The latter case is provided in considerationthat the “coding tool configured to skip the transform/inverse transformoperation for the residual sample” and the “coding tool configured toacquire prediction information about a current block from another blocklocated in a current picture containing the current block” may beapplied with a high probability when the characteristics of a video arescreen content. In addition, the latter case is provided inconsideration that the “coding tool configured to selectively apply oneor more of various transform kernels to residual samples to which atransform operation is applied” may be applied with a high probabilitywhen the characteristics of a video are not screen content.

In the following, whether to enable the target coding tool and whetherto apply the SCC to the target coding tool will be collectivelyexpressed as “whether to enable the target coding tool.” The high levelof the bitstream, in which the enable flag is defined, represents ahigher level than other levels (low levels) in the bitstream describedbelow. The high level may be an SPS level, a PPS level, a picture level(including a picture header), a slice level (including a slice header),a tile level (including a tile header), a brick level, or the like.

FIG. 5 shows an exemplary block diagram of a video decoding apparatuscapable of controlling a target coding tool using the enable flag, andFIG. 6 shows a flowchart illustrating an example of the method ofcontrolling a target coding tool. As shown in FIG. 5, the video decodingapparatus may include an entropy decoder 410, an acquisition unit 510,and an execution unit 520.

The video encoding apparatus may be configured to determine whether toenable one or more of the target coding tools, and set a value of theenable flag in accordance with the result. In addition, the videoencoding apparatus may be configured to encode the enable flag in thehigh level of the bitstream to signal the same to the video decodingapparatus. The enable flag equal to 1 indicates that the target codingtool is enabled, and the enable flag equal to 0 indicates that thetarget coding tool is not enabled. The entropy decoder 410 may beconfigured to decode the enable flag from the high level of thebitstream (S610).

The video encoding apparatus may be configured to determine whether toapply or execute the target coding tool. In addition, the video encodingapparatus may be configured to determine whether to signal anapplication flag indicating whether to apply or execute the targetcoding tool, based on the value of the enable flag. For example, whenthe enable flag is equal to 1, the application flag may not be signaled.When the enable flag is equal to 0, the application flag may be encodedand signaled to the video decoding apparatus in the low level of thebitstream. As another example, when the enable flag is equal to 1, theapplication flag may be encoded and signaled to the video decodingapparatus in the low level of the bitstream. When the enable flag isequal to 0, the application flag may not be signaled. The applicationflag equal to 1 indicates that the target coding tool is applied, andthe application flag equal to 0 indicates that the target coding tool isnot applied.

The application flag may indicate whether to apply to the entirety ofcoding tools included in the target coding tools, or may indicatewhether to apply one or more of the coding tools included in the targetcoding tools. In the latter case, the application flag may be dividedinto a first application flag indicating whether to apply the firstcoding tool and a second application flag indicating whether to applythe second coding tool.

The acquisition unit 510 may be configured to set the application flagto a predetermined value or may acquire the value of the applicationflag by decoding the application flag from the low level of thebitstream, depending on the value of the enable flag (S620). Forexample, when the enable flag is equal to 1, the application flag may beimplicitly set to 1. When the enable flag is equal to 0, the applicationflag may be decoded from a low level of the bitstream. As anotherexample, when the enable flag is equal to 1, the application flag may bedecoded from a low level of the bitstream. When the enable flag is equalto 0, the value of the application flag may be implicitly set to 0.

The video encoding apparatus may be configured to encode an encodingtarget by executing the target coding tool when the target coding toolis applied, but may not execute the target coding tool when the targetcoding tool is not applied. The execution unit 520 may be configured toexecute the target coding tool when the acquired value of theapplication flag indicates that the target coding tool is applied, andnot execute the target coding tool when the acquired value of theapplication flag indicates the target coding tool is not applied (S630).

Two examples related to acquisition of the value of the application flagaccording to the value of the enable flag are shown in FIGS. 7 and 8,respectively. As shown in FIG. 7, the acquisition unit 510 may beconfigured to determine whether the value of the enable flag is equal to1 or 0 (S710). When the enable flag is equal to 1, the application flagmay not be signaled from the video encoding apparatus, and thus theacquisition unit 510 may be configured to set the application flag to avalue (1, a predetermined value) indicating that the target coding toolis applied (S720). In contrast, when the enable flag is equal to 0, theapplication flag is signaled from the video encoding apparatus, and thusthe acquisition unit 510 may be configured to acquire the value bydecoding the application flag from the low level of the bitstream(S730).

The execution unit 520 may be configured to determine whether theacquired value of the application flag is equal to 1 or 0 (S740). Theexecution unit 520 may be configured to execute the target coding toolwhen the application flag is equal to 1 (S750), and not execute thetarget coding tool when the application flag is equal to 0 (S760).

As shown in FIG. 8, the acquisition unit 510 may be configured todetermine whether the value of the enable flag is equal to 1 or 0(S810). When the enable flag is equal to 1, the application flag issignaled from the video encoding apparatus, and thus the acquisitionunit 510 may be configured to acquire a value by decoding theapplication flag from a low level of the bitstream (S820). In contrast,when the enable flag is equal to 0, the application flag is not besignaled from the video encoding apparatus, and thus the acquisitionunit 510 may be configured to set the application flag to a value (0, apredetermined value) indicating that the target coding tool is not beapplied (S830).

The execution unit 520 may be configured to determine whether theacquired value of the application flag is equal to 1 or 0 (S840). Theexecution unit 520 may be configured to execute the target coding toolwhen the application flag is equal to 1 (S850), and not execute thetarget coding tool when the application flag is equal to 0 (S860).

As described above, according to the coding tool control method of thepresent disclosure, since the signaling of the application flag definedat the low level is determined according to the value of the enable flagdefined at the high level, the operation of the target coding tool maybe controlled at the high level. Thus, bit efficiency may be improved.In addition, the improvement of bit efficiency may reduce the bit raterequired for various contents such as gaming broadcasting, 360-degreevideo streaming, VR/AR video, and online lectures. As a result, theburden on the network may be reduced, and improvement in energyefficiency of a video playback apparatus (video decoding apparatus) todecode various contents and rapid decoding may be achieved.

Hereinafter, examples of application of the coding tool control methodto each of the target coding tools will be described one by one.

Coding Tool Configured to Skip the Transform/Inverse Transform Operation

Transform for residual samples is a technique that transforms theresidual samples from the pixel domain to the frequency domain inconsideration of the importance of efficient video compression andvisual perception, and inverse transform for residual samples is atechnique that transforms the residual samples from the frequency domainto the pixel domain.

However, in the case of an unnatural image such as screen content, suchtransform/inverse transform techniques may be inefficient. Inparticular, the transform/inverse transform techniques may be skipped(transform skip). When transform/inverse transform of the residualsamples is skipped, only scaling (quantization/inverse quantization) maybe performed for the residual samples, or only entropy encoding/decodingmay be performed without the scaling.

In conventional encoding/decoding method, the size of a transform blockis set to 4×4, 8×8, 16×16, or 32×32, and the transform or the transformskip may be applied to the transform blocks. When the transform isapplied to a transform block, the video decoding apparatus may beconfigured to inversely quantize the quantized transform coefficients(TransCoeffLevel[x][y]) and inversely transform the inversely quantizedtransform coefficients (d[x][y]) from the frequency domain to thespatial domain to reconstruct the residual samples (r[x] [y]).Additionally, the video decoding apparatus may be configured to shiftthe reconstructed residual samples according to a bit depth of the imageto derive shifted residual samples.

In the conventional encoding/decoding method, the transform skip may beapplied to a transform block having a size of 4×4, or may be applied toa transform block having a different size according to an additionalsyntax element. When the transform skip is applied to the transformblock, the video decoding apparatus may be configured to inverselyquantize the quantized transform coefficients (TransCoeffLevel[x][y])and perform a shift operation on the inversely quantized transformcoefficients (d[x] [y]) to reconstruct the residual samples (r[x][y]).Additionally, the video decoding apparatus may be configured to shiftthe reconstructed residual samples according to the bit depth of theimage to derive shifted residual samples. In particular, the shiftoperation performed on the inversely quantized transform coefficients isapplied instead of the transform technique.

When a flag to indicate whether a rotation technique is applied to thetransform-skipped residual samples indicates that the rotation techniqueis applied, the transform-skipped residual samples may be rotated about180 degrees. Accordingly, the video decoding apparatus may be configuredto scan residual samples in the opposite direction or in the reverseorder in consideration of symmetry (rotation).

According to the conventional encoding/decoding method, a syntax element(transform skip flag) indicating whether a transform technique isapplied to a transform block is signaled for each transform unit, andaccordingly bit efficiency may be degraded. In addition, according tothe conventional encoding/decoding method, a syntax element (a presenceflag) indicating whether a transform skip flag is present in thetransform unit is additionally signaled, and accordingly the bitefficiency may be further degraded.

As described above, when the enable flag (for example,pic_scc_tool_enabled_flag) proposed in the present disclosure issignaled at the high level, signaling of the presence flag as well assignaling of the transform skip flag may be skipped. For example, whenthe enable flag is equal to 1, the application flag (transform skip flagand presence flag) may not be signaled, and may be implicitly set to 1.When the enable flag is equal to 0, the application flag may be decodedfrom the low level of the bitstream. As another example, when the enableflag is equal to 1, the application flag may be decoded from the lowlevel of the bitstream. When the enable flag is equal to 0, theapplication flag may not be signaled, but may be implicitly set to 0.Accordingly, signaling of the application flag may be skipped, therebyimproving bit efficiency.

Coding Tool Configured to Selectively Apply Transform Kernels

When a transform technique is applied to the residual samples, theDCT-II transform kernel (transform type) is generally applied to theresidual samples. However, to apply a more appropriate transformtechnique according to various characteristics of the residual samples,a coding tool configured to selectively apply one or two optimaltransform kernels from among several transform kernels to the residualsamples may be executed.

The transform kernels that may be used in this coding tool are shown inTable 1.

TABLE 1 Transform Type Basis function T_(i)(j), i, j = 0, 1, . . . N-1DCT-II${{T_{i}(j)} = {{\omega_{0} \cdot \sqrt{\frac{2}{N}} \cdot {\cos\left( \frac{\pi \cdot i \cdot \left( {{2j} + 1} \right)}{2N} \right)}}\mspace{14mu}{where}}},\;{\omega_{0} = \left\{ \begin{matrix}\sqrt{\frac{2}{N}} & {i = 0} \\1 & {i \neq 0}\end{matrix} \right.}$ DCT-VIII${T_{i}(j)} = {\sqrt{\frac{4}{{2N} + 1}} \cdot {\cos\left( \frac{\pi \cdot \left( {{2i} + 1} \right) \cdot \left( {{2j} + 1} \right)}{{4N} + 2} \right)}}$DST-VII${T_{i}(j)} = {\sqrt{\frac{4}{{2N} + 1}} \cdot {\sin\left( \frac{\pi \cdot \left( {{2i} + 1} \right) \cdot \left( {j + 1} \right)}{{2N} + 1} \right)}}$

Syntax elements of a coding tool configured to selectively apply atransform kernel may be encoded and signaled from a video encodingapparatus to a video decoding apparatus through a block level. When thecoding tool is applied, syntax elements (a horizontal flag and avertical flag) for selecting a transform kernel in a horizontaldirection and a transform kernel in a vertical direction may besignaled. A transform kernel applied to the horizontal direction and atransform kernel applied to the vertical direction may be differentlyselected through the horizontal flag and the vertical flag. Table 2shows mapping between the application flag, the horizontal flag and thevertical flag.

TABLE 2 Application Horizontal Vertical Intra/inter flag flag flagHorizontal Vertical 0 DCT-II 1 0 0 DST-VII DST-VII 0 1 DCT-VIII DST-VII1 0 DST-VII DCT-VIII 1 1 DCT-VIII DCT-VIII

As described above, when the enable flag proposed in the presentdisclosure is signaled in the high level, signaling of the applicationflag, the horizontal flag, and the vertical flag may be skipped if thetransform technique is skipped. This is because, when the enable flag isequal to 1, there is a high possibility that the transform technique isskipped within an associated picture.

For example, when the enable flag is equal to 1, the application flagmay not be signaled and may be implicitly set to 1. When the enable flagis equal to 0, the application flag may be decoded from the low level ofthe bitstream. As another example, when the enable flag is equal to 1,the application flag may be decoded from the low level of the bitstream.When the enable flag is equal to 0, the application flag may not besignaled and may be implicitly set to 0. In those two examples,signaling of the horizontal flag and the vertical flag may be skippedwhen the application flag is equal to 0, but may be signaled when theapplication flag is equal to 1. Accordingly, signaling of theapplication flag, the horizontal flag, and the vertical flag may beskipped, thereby improving bit efficiency.

Some exemplary embodiments, in the present disclosure, may furtherdetermine whether to skip the transform for DUAL_TREE_CHROMA.Conventionally, in the case of DUAL_TREE_CHROMA, the transform skip isnot applied. In the present disclosure, on the other hand, tu_cbf_cb ortu_cbf_cr, which is a cbf flag for the chroma component may be checked.Then, when there is a chroma residual sample and the size of thetransform block does not exceed the maximum size allowing the transformskip to be applied, the transform skip method applied to the lumacomponent may be applied to the chroma component.

Coding Tool Configured to Acquire Prediction Information about a CurrentBlock from Another Block Located in a Current Picture

In the prior art, a syntax element indicating whether the coding tool isenabled is encoded and signaled at the SPS level, and a syntax element(application flag) indicating whether the current block is encoded bythe coding tool is signaled in a block level when the coding tool isenabled.

With the conventional method as described above, the application flag issignaled for every block, and accordingly bit efficiency may bedegraded. As described above, when signaling of whether the SCC is usedfor a unit of a high level including the current block(pic_scc_tool_enabled_flag, enable flag) is performed at the high level,the application flag does not need to be signaled for every block whenthe SCC is not applied, and therefore the bit efficiency may beimproved.

For example, when the enable flag is equal to 1, the application flagmay not be signaled and may be implicitly set to 1. When the enable flagis equal to 0, the application flag may be decoded from the low level ofthe bitstream. As another example, when the enable flag is equal to 1,the application flag may be decoded from the low level of the bitstream.When the enable flag is equal to 0, the application flag may not besignaled and may be implicitly set to 0.

According to an exemplary embodiment, the enable flag may include anenable flag defined in the slice header level and an enable flag(pic_scc_tool_enabled_flag) defined at a relatively higher level thanthe slice header level. When the enable flag defined at the higher levelis equal to 0, the enable flag defined at the slice header level may beencoded, signaled to the video decoding apparatus, and decoded by thevideo decoding apparatus. In particular, when the enable flag defined atthe slice header level is not present in the bitstream, signaling anddecoding of the application flag may be skipped.

First Coding Tool

The first coding tool represents the coding tool configured to mapprediction samples and scale residual samples using a piece-wise linearmodel. The first coding tool may be additionally applied to each blockbefore in-loop filtering. The first coding tool may exhibit highcompression efficiency for a video having the characteristics of screencontent.

FIG. 9 shows an exemplary block diagram illustrating the first codingtool. The first coding tool may include two major operations. Oneoperation is to in-loop mapping luma prediction samples based on theadaptive piecewise linear model, and the other operation is to scale thechroma residual samples according to the value of the luma reconstructedsamples. In FIG. 9, inverse quantization/inverse transform, luma samplereconstruction, and intra-prediction of luma are processed within amapped domain. The first coding tool is applied to the chroma residualsample scaling, mapping, and luma inter prediction. The remaining blocksare functions performed in the original unmapped domain.

Mapping of the luma prediction sample may include an operation ofadjusting a dynamic range by redistributing codewords for the lumaprediction samples to improve compression efficiency, and an operationof reversely mapping luma reconstructed samples in the mapped domain toan unmapped domain. In particular, the luma reconstructed sample may bederived by summing the mapped luma prediction sample and the lumaresidual sample, and the luma residual sample is signaled in a mappeddomain by the video encoding apparatus.

Whether to enable the first coding tool may be determined based onenable flags defined at two or more levels in the bitstream. One of theenable flags may be signaled at a higher level than the other one. Theenable flag signaled at the higher level is referred to “a first enableflag,” and the enable flag signaled at the lower level is referred to “asecond enable flag”.

The first enable flag equal to 1 may indicate that the first coding toolis enabled at the higher level, and the first enable flag equal to 0 mayindicate that the first coding tool is not enabled at the higher level.The second enable flag may be encoded and signaled when the first enableflag is equal to 1. The second enable flag equal to 1 indicates that thefirst coding tool is enabled at the lower level, and the second enableflag equal to 0 may indicate that the first coding tool is not enabledat the lower level.

Whether to apply the first coding tool may be determined based on anapplication flag (first application flag) defined at a level lower thanthose of the enable flags in the bitstream. The first application flagmay be signaled when the second enable flag is equal to 1 or may be setto a predetermined value (or 1). In another example, the firstapplication flag may be signaled when the second enable flag is equal to0 or may be set to the predetermined value (or 0).

To determine whether to apply the first coding tool, a method in whichthe first application flag is encoded, signaled and decoded for everylower level may be undesirable in term of bit efficiency. The presentdisclosure is directed to improving the bit efficiency of the firstcoding tool by defining, at the high level of the bitstream, an enableflag (the second enable flag) which indicates whether to enable thefirst coding tool.

FIG. 10 shows an exemplary block diagram of a video decoding apparatuscapable of controlling the first coding tool using the second enableflag, and FIG. 11 illustrates an example method of controlling the firstcoding tool using the second enable flag. As shown in FIG. 10, the videodecoding apparatus may include an entropy decoder 410, an acquisitionunit 510, an execution unit 520, and a derivation unit 1010. Theexecution unit 520 may include a section determination unit 522 and asample derivation unit 524. The derivation unit 1010 may include a firstderivation unit 1012, a second derivation unit 1014, and a factorderivation unit 1016.

The video encoding apparatus may be configured to determine whether toenable the first coding tool for a sequence containing a current block,and set a value of the first enable flag in accordance with thedetermination result. The first enable flag may be encoded and signaledto the video decoding apparatus in the SPS level of the bitstream. Inaddition, when the first enable flag is equal to 1, the video encodingapparatus may be configured to determine whether the first coding toolis enabled for a picture containing the current block, and set a valueof the second enable flag in accordance with the determination result.The second enable flag may be encoded and signaled to the video decodingapparatus in a picture level (including a picture header) of thebitstream.

Further, when the second enable flag is equal to 1, the video encodingapparatus may be configured to determine whether the first coding toolis applied to a slice containing the current block, and set the value ofthe first application flag in accordance with the determination result.The first application flag may be encoded and signaled to the videodecoding apparatus through the slice level (including a slice header) ofthe bitstream.

The entropy decoder 410 may be configured to decode the first enableflag from the SPS level of the bitstream (S1110), and determine whetherto enable the first coding tool based on the value of the first enableflag (S1120). In addition, when the first enable flag is equal to 1, theentropy decoder 410 may be configured to decode the second enable flagfrom the picture level of the bitstream (S1130), and determine whetherto enable the first coding tool based on the value of the second enableflag (S1140).

When the second enable flag is equal to 1, the acquisition unit 510 maybe configured to acquire the value of the first application flag bydecoding the first application flag from the slice level of thebitstream (S1160). In this example, when the second enable flag is equalto 0, the first application flag may not be signaled and may beimplicitly set to 0. In some exemplary embodiments, when the secondenable flag is equal to 0, the acquisition unit 510 may be configured toacquire the value of the first application flag by decoding the firstapplication flag from the slice level of the bitstream (S1160). In thisexample, when the second enable flag is equal to 1, the firstapplication flag may not be signaled and may be implicitly set to 1.

The execution unit 520 may be configured to execute the first codingtool when the first application flag is equal to 1 (S1170), and notexecute the first coding tool when the first application flag is equalto 0 (S1180). The first coding tool is also not executed when the firstenable flag is equal to 0 in S1120 or the second enable flag is equal to0 in S1140 (S1180).

Hereinafter, detailed operations performed in the first coding tool willbe described.

Luma Prediction Sample Mapping

The piecewise linear model may represent a relationship between thedynamic range of the input signal and the dynamic range of the outputsignal. The dynamic range of the input signal is divided into a presetnumber of equal sections, and a piecewise linear model for each sectionis represented based on the number of codewords allocated to eachsection. For example, when an input image has a bit depth of 10 bits andthe preset number of sections is 16, 64 code words may be basicallyallocated to each of the 16 sections.

Mapping of a luma prediction sample is a method by which the dynamicrange of an inter-predicted luma prediction sample is divided into apreset number of sections, a code word of the luma prediction sample isredistributed by applying the piecewise linear model corresponding to asection which the luma prediction sample belongs to, and thereby theluma prediction sample in a domain (original domain) prior to mapping ismapped to a mapped domain. A luma prediction sample mapped from the lumaprediction sample based on the piecewise linear model is a “mapped lumaprediction sample.” Since intra-prediction is performed within themapped domain, the mapping is not applied to a block encoded in theintra-mode.

The video encoding apparatus is configured to perform mapping on theluma prediction sample based on the piecewise linear model (generate amapped luma prediction sample), and encode information on sections(second sections) to which the mapped luma prediction sample may belongand signal the same to the video decoding apparatus.

The information on the second sections may include “index information(section index information) about sections that may be used for thefirst coding tool among the second sections” and “code word numberinformation.” The section index information may include indexinformation about a section having a minimum index and index informationabout a section having a maximum index among the sections that may beused for the first coding tool. The code word number information mayinclude information (absolute value and sign of the difference)indicating the difference (code word delta) between the number of codewords allocated to or included in the original sections (first sections)and the number of code words allocated to each of the second sectionsthat may be used for the first coding tool. Hereinafter, the absolutevalue of the difference will be referred to as a “code word absolutevalue,” and the sign of the difference will be referred to as a “codeword sign.”

As shown in FIG. 12, the entropy decoder 410 may be configured to decodeinformation on the second sections from the bitstream (S1210). Thederivation unit 1010 may be configured to derive a piecewise linearmodel of each of the first sections based on the information on thesecond sections and the bit depth of the image (namely, the mappingrelationship between the first sections and the second sections may bederived) (S1220). In particular, the piecewise linear model, that is,the mapping relationship, may include a “scaling factor representing ascaling relationship between the number of code words (number of bits)allocated to each of the first sections and the number of code words(number of bits) allocated to each of the second sections.” The scalingfactor may represent a relationship between the length of each of thefirst sections and the length of each of the second sections.

The section determination unit 512 may be configured to determine asection (first target section) to which the luma prediction samplebelongs among the first sections, and the sample derivation unit 514 maybe configured to derive a mapped luma prediction sample by mapping aluma prediction sample to the mapping section using a piecewise linearmodel corresponding to the first target section (S1240). In other words,in S1240, the sample derivation unit 514 is configured to derive amapped luma prediction sample by applying the mapping relationshipbetween the first target section and the mapping section to the lumaprediction sample. Particularly, the mapping section may be a sectioncorresponding to the first target section among the second sections.Correspondence between each of the first sections and each of the secondsections may be an index assigned to each section or a position of eachsection in order.

FIG. 13 shows an example of a specific method of deriving the scalingfactor included in the mapping relationship. The first derivation unit1012 may be configured to derive the number of code words allocated toeach of the first sections based on the bit depth (S1310). As describedabove, the same number of code words may be allocated to or included ineach of the first sections. In other words, the first sections may havethe same size.

The second derivation unit 1014 may be configured to derive the numberof code words allocated to each of the second sections based on thenumber of code words allocated to each of the first sections and theinformation on the second sections (S1320)). Specifically, a code worddelta corresponding to a second section may be derived by applying acode word sign to the absolute value of the code word, and the number ofcode words allocated to the second section may be derived by summing thenumber of code words allocated to each of the first sections and thecode word delta. The factor derivation unit 1016 may be configured toderive a scaling factor base on the number of code words allocated toeach of the first sections and the number of code words allocated toeach of the second sections (S1330).

Inverse Mapping of Luma Reconstructed Samples

Inverse mapping is an operation of reversely mapping a mapped lumareconstructed sample to the unmapped domain. The mapped lumareconstructed sample may be derived by summing the mapped lumaprediction sample and the luma residual sample which is signaled in amapped domain by the video encoding apparatus.

As shown in FIG. 14, the derivation unit 1010 may be configured toderive an inverse piecewise linear model of each of the second sectionsbased on the bit depth and the information on the second sections (i.e.,it may derive a reverse mapping relationship between the first sectionsand the second sections) (S1410). For example, the derivation unit 1010may be configured to derive an inverse scaling factor based on thenumber of code words allocated to each of the first sections and thenumber of code words allocated to each of the second sections. Inparticular, the inverse scaling factor is a parameter representing theinverse scaling relationship between each of the first sections and eachof the second sections, and may be used for defining the inversepiecewise linear model or the reverse mapping relationship.

The inverse piecewise linear model may have a reverse relationship withthe piecewise linear model used to map the luma prediction sample. Thereverse mapping relationship may have a reverse relationship with themapping relationship used for the mapping of the luma prediction sample.The section determination unit 522 may be configured to determine asecond target section (S1420). The second target section may be asection to which the luma reconstructed sample belongs among the secondsections (a section to which the luma reconstructed sample belongsbefore reverse mapping).

The sample derivation unit 524 may be configured to reversely map theluma reconstructed sample to a reverse mapping section using an inversepiecewise linear model corresponding to the second target section,thereby deriving or generating an reversely mapped luma reconstructedsample (S1430). In other words, the sample derivation unit 524 may beconfigured to apply the reverse mapping relationship between the secondtarget sections and the reverse mapping section to the lumareconstructed sample (reversely map the luma reconstructed sample) toderive the reversely mapped luma reconstructed sample. Particularly, thereverse mapping section may be a section to which the reversely mappedluma reconstructed sample belongs among the first sections or a sectioncorresponding to the second target section. Correspondence between eachof the first sections and each of the second sections may be an indexallocated to each section or a position of each section in order.

Chroma Residual Sample Scaling

Scaling of chroma residual samples refers to a method of scaling chromaresidual samples according to values of luma reconstructed samples.Scaling of the chroma residual samples may be performed when the firstapplication flag is equal to 1 or the chroma flag is equal to 1, whichwill be described below. In addition, scaling of the chroma residualsamples may be performed when the size of the chroma residual samples(chroma residual block) exceeds a preset value (e.g., 4).

The video encoding apparatus may be configured to determine whether toperform scaling on the chroma residual samples of the current block, andset a value of the chroma flag in accordance with the determinationresult. The chroma flag may indicate whether scaling of chroma residualsamples is enabled for and/or applied to a current picture containingthe current block. The chroma flag equal to 1 indicates that the scalingof the chroma residual samples is enabled and/or applied, and the chromaflag equal to 0 may indicate that the scaling of the chroma residualsamples is not enabled and/or not applied. When the second enable flagis equal to 1, the chroma flag may be encoded and signaled to the videodecoding apparatus at the picture level or slice level of a bitstream.

As shown in FIG. 15, when the second enable flag is equal to 1 (S1510),the entropy decoder 410 may be configured to decode the chroma flag fromthe picture level of the bitstream (S1520). When the application flag isequal to 1 (S1530) and the chroma flag is equal to 1 (S1540), theexecution unit 520 may be configured to derive scaled chroma residualsamples by performing scaling on the chroma residual samples (S1550).Scaling of the chroma residual samples may be performed using chromascaling information decoded from the bitstream.

The chroma scaling information, which is information for compensatingfor the correlation between the luma component and the chromacomponents, is provided to adjust the dynamic range of the secondsections used for mapping of the luma prediction sample to be suitablefor scaling of the chroma residual samples. When the second enable flagis equal to 0 in operation S1510, the application flag is equal to 0 inS1530, or the chroma flag is equal to 0 in S1540, scaling of the chromaresidual samples may be skipped (S1560).

The video encoding apparatus may be configured to perform scaling onchroma residual samples, and derive a difference between the number ofcodewords included in each of the second sections before the scaling andthe number of codewords included in each of the second sections afterthe scaling. In addition, the video encoding apparatus may be configuredto encode information (chroma scaling information) on the derivationresult (difference value) and signal the same to the video decodingapparatus. The chroma scaling information may include a delta chromacode word size, which is a magnitude of the difference value, and adelta chroma code word sign, which is a sign of the difference value.

The entropy decoder 410 may be configured to decode the chroma scalinginformation from the bitstream (S1610). The derivation unit 1010 may beconfigured to derive a scaling relationship based on the bit depth,information on the second sections, and the chroma scaling information(S1620). For example, the derivation unit 1010 may be configured toderive a delta chroma code word (a difference between the number ofcodewords included in each of the second sections and the number of codewords included in each of third sections) based on the delta chroma codeword size and the delta chroma code word sign, and adjust the dynamicrange of the second sections by summing the number of code wordsincluded in each of the second sections and the delta chroma code word,thereby deriving the chroma scaling relationship between the secondsections.

The chroma scaling relationship derived by the derivation unit 1010 mayhave a reverse relationship to the chroma scaling relationship used forscaling of the chroma residual samples by the video encoding apparatus.Accordingly, the chroma scaling relationship derived by the derivationunit 1010 may be a reverse chroma scaling relationship. The sectiondetermination unit 522 may be configured to derive an average of theluma reconstructed samples positioned on the left of the chroma residualsamples (current block) and the luma reconstructed samples positionedabove the chroma residual samples (current block) (S1630), and determinea section to which the average belongs among the second sections(S1640). The sample derivation unit 524 may be configured to generate orderive the scaled chroma residual samples by scaling the chroma residualsamples based on the chroma scaling relationship corresponding to thesection to which the average belongs (S1650)

Second Coding Tool

The second coding tool is a coding tool configured to apply differentialcoding to residual samples to improve compression performance ofresidual samples to which the transform skip mode is applied. When atransform unit (TU) is encoded in the transform skip mode for lossycompression, the differential coding technique may be applied to theresidual samples after intra prediction and inter prediction. In thetransform skip mode, the differential coding technique may provide moreimproved compression performance by reducing the total amount of energyof the residual components for entropy coding.

In horizontal differential coding, a current sample is predicted using aresidual sample of the nearest left column in the horizontal directionamong samples encoded by the video encoding apparatus. After applyingthe horizontal differential coding to the residual samples of an M×Nblock, the residual samples (where 0≤i<M, and i is a natural number) maybe expressed by Equation 1. In other words, the residual sample atposition (i, j) is modified through subtraction with a residual sampleat position (i, j−1).

$\begin{matrix}{{\overset{\sim}{r}}_{i,j} = \left\{ \begin{matrix}{{Q\left( r_{i,j} \right)},} & {{i = 0},{0 \leq j \leq \left( {N - 1} \right)}} \\{{{Q\left( r_{i,j} \right)} - {Q\left( r_{{({i - 1})},j} \right)}},} & {{1 \leq i \leq \left( {M - 1} \right)},{0 \leq j \leq \left( {N - 1} \right)}}\end{matrix} \right.} & {{Equation}\mspace{14mu} 1}\end{matrix}$

In Equation 1, (i, j) denotes the i-th row and j-th column, Q(r_(i,j))denotes a residual sample at position (i, j), and {tilde over (r)}_(i,j)denotes a modified residual sample.

As shown in Equation 1, in the horizontal differential coding, the videoencoding apparatus entropy-encodes the modified residual sample and thentransmits the same to the video decoding apparatus. The sample isreconstructed and reserved for prediction of a residual sample in thenext column. The horizontal prediction operation may be sequentiallyperformed on all columns of the block.

In the vertical differential coding, a current sample is predicted usinga residual sample of the nearest upper row in a vertical direction amongthe residual samples encoded by the video encoding apparatus. Afterapplying the vertical differential coding to the residual samples of anM×N block, the residual samples (where 0≤j<N, and j is a natural number)may be expressed by Equation 2.

$\begin{matrix}{{\overset{\sim}{r}}_{i,j} = \left\{ \begin{matrix}{{Q\left( r_{i,j} \right)},} & {{0 \leq i \leq \left( {M - 1} \right)},{j = 0}} \\{{{Q\left( r_{i,j} \right)} - {Q\left( r_{i,{({j - 1})}} \right)}},} & {{1 \leq i \leq \left( {M - 1} \right)},{0 \leq j \leq \left( {N - 1} \right)}}\end{matrix} \right.} & {{Equation}\mspace{14mu} 2}\end{matrix}$

As shown in Equation 2, in the vertical differential coding, the videoencoding apparatus entropy-encodes the modified residual sample and thentransmits the same to the video decoding apparatus. The sample isreconstructed and reserved for prediction of a residual sample in thenext row. The vertical prediction operation may be sequentiallyperformed on all rows of the block.

When the horizontal differential coding is applied, the video decodingapparatus is configured to reconstruct the residual samples as shown inEquation 3. In other words, the residual samples in the residual blockreconstructed from the bitstream by the video decoding apparatus aremodified according to the horizontal differential coding. A targetresidual sample to be modified in the reconstructed residual block ismodified in such a manner that left residual samples positioned on theleft of the target residual sample in the same row as the targetresidual sample are added to the target residual sample.

Q(r _(i,j))=Σ_(k=0) ^(j) Q({tilde over (r)} _(i,k)),0≤j≤N  Equation 3

The video decoding apparatus may be configured to reconstruct theresidual samples of the j-th column by sequentially adding thereconstructed residual samples. The horizontal reconstruction operationmay be sequentially performed on all columns of the block.

When the vertical differential coding is applied, the video decodingapparatus reconstructs the residual samples as shown in Equation 4. Inother words, the residual samples in the residual block reconstructedfrom the bitstream by the video decoding apparatus are modifiedaccording to the vertical differential coding. A target residual sampleto be modified in the reconstructed residual block is modified in such amanner that left residual samples positioned above the target residualsample in the same column as the target residual sample are added to thetarget residual sample.

Q(r _(i,j))=Σ_(k=0) ^(i) Q({tilde over (r)} _(k,j)),0≤i≤N  Equation 4

The video decoding apparatus may be configured to reconstruct theresidual samples of the i-th row by sequentially adding thereconstructed residual samples. The vertical reconstruction operationmay be sequentially performed on all rows of the block. Whether toexecute the second coding tool may be determined by the secondapplication flag defined at the block level. However, with theconventional method, bit efficiency may be degraded because the secondapplication flag is encoded, signaled and decoded on a block-by-blockbasis.

As described above, since the second coding tool is applied to thetransform-skipped residual samples, it may be applied with a highprobability to a video having characteristics of screen content.Therefore, focusing on these characteristics, the present disclosure isintended to define, at a level higher than the block level, an enableflag indicating whether the second coding tool is enabled (or whetherthe video corresponds to the screen content), and control whether tosignal the second application flag according to the value of the enableflag to improve bit efficiency.

The video encoding apparatus may be configured to determine whether thesecond coding tool is enabled (whether the video corresponds to thescreen content) and set a value of the enable flag in accordance withthe determination result. In addition, the video encoding apparatus maybe configured to encode the enable flag and signal the same to the videodecoding apparatus in a high level (e.g., SPS level) of the bitstream.The video decoding apparatus may be configured to decode the enable flagfrom the high level of the bitstream (S1710), and determine whether thevalue of the decoded enable flag is equal to 1 or 0 (S1720).

The video encoding apparatus may be configured to determine whether thesecond coding tool is applied to the current block, and determinewhether to signal the second application flag based on the value of theenable flag. For example, the video encoding apparatus may be configuredto encode the second application flag and signal the same to the videodecoding apparatus when the enable flag is equal to 1, and not signalthe second application flag when the enable flag is equal to 0. Inparticular, the video decoding apparatus may be configured to decode thesecond application flag from the bitstream when the enable flag is equalto 1 since the second application flag is signaled (S1730), and notdecode the second application flag when the enable flag is equal to 0since the second application flag is not signaled. When the secondapplication flag is not decoded, the second application flag may be setto a value (of 0) implicitly indicating that the second coding tool isnot applied.

As another example, the video encoding apparatus may not signal thesecond application flag when the enable flag is equal to 1, and may beconfigured to signal the second application flag when the enable flag isequal to 0. In particular, the video decoding apparatus may beconfigured to decode the second application flag from the bitstream whenthe enable flag is equal to 0 since the second application flag issignaled, and may not decode the second application flag when the enableflag is equal to 1 because the second application flag is not signaled.When the second application flag is not decoded, the second applicationflag may be set to a value (of 1) implicitly indicating that the secondcoding tool is applied.

The video decoding apparatus may be configured to determine the value ofthe decoded or set second application flag is equal to 1 or 0 (S1740),execute the second coding tool when the second application flag is equalto 1 (S1750), and not execute the second coding tool when the secondapplication flag is equal to 0 (S1760). According to an exemplaryembodiment, the enable flag may include pic_scc_tool_enabled_flagindicating whether the image corresponds to the screen content, and aflag (slice flag) indicating whether the second coding tool is enabledon a slice-by-slice basis.

When the current image corresponds to the screen content(pic_scc_tool_enabled_flag is equal to 1), the slice flag may be encodedand signaled from the video encoding apparatus to the image decodingdevice, and decoded by the video decoding apparatus. In particular,whether to signal and decode the second application flag may bedetermined according to the value of the slice flag.

For example, the video encoding apparatus may be configured to encodethe second application flag and signal the same to the video decodingapparatus when the slice flag is equal to 1, and not signal the secondapplication flag when the slice flag is equal to 0. In particular, thevideo decoding apparatus may be configured to decode the secondapplication flag from the bitstream when the slice flag is equal to 1since the second application flag is signaled (S1730), and not decodethe second application flag when the slice flag is equal to 0 since thesecond application flag is not signaled. When the second applicationflag is not decoded, the value of the second application flag may be setto a value (of 0) implicitly indicating that the second coding tool isnot applied.

As another example, the video encoding apparatus may not signal thesecond application flag when the slice flag is equal to 1, and maysignal the second application flag when the slice flag is equal to 0. Inparticular, the video decoding apparatus may be configured to decode thesecond application flag from the bitstream when the slice flag is equalto 0 because the second application flag is signaled, and not decode thesecond application flag when the slice flag is equal to 1 because thesecond application flag is not signaled. When the second applicationflag is not decoded, the second application flag may be set to a value(of 1) implicitly indicating that the second coding tool is applied.

Although exemplary embodiments of the present invention have beendescribed for illustrative purposes, those skilled in the art willappreciate that and various modifications and changes are possible,without departing from the idea and scope of the invention. Exemplaryembodiments have been described for the sake of brevity and clarity.Accordingly, one of ordinary skill would understand that the scope ofthe exemplary embodiments is not limited by the exemplary embodimentsexplicitly described above but is inclusive of the claims andequivalents thereto.

What is claimed is:
 1. A video decoding method, comprising: decoding,from a high level of a bitstream, an enable flag indicating whether oneor more coding tools are enabled, the one or more coding tools includinga first coding tool configured to encode sample values using lumacomponent mapping based on a piecewise linear model; acquiring a valueof an application flag depending on a value of the enable flag, bysetting the application flag indicating whether to apply the one or morecoding tools to a predetermined value, or by decoding the applicationflag from a low level of the bitstream, the application flag including afirst application flag indicating whether to apply the first codingtool; and when the value of the application flag is a value indicatingthat the one or more coding tools are applied, executing the one or morecoding tools, wherein, when the first coding tool is executed accordingto a value of the first application flag, the executing of the one ormore coding tools includes: generating a mapped luma prediction samplefrom a luma prediction sample based on a piecewise linear modelcorresponding to the luma prediction sample, and generating a lumareconstructed sample by adding a luma residual sample reconstructed fromthe bitstream and the mapped luma prediction sample; and reverselymapping the luma reconstructed sample using an inverse piecewise linearmodel having an inverse relationship with the piecewise linear model. 2.The method of claim 1, wherein the acquiring includes: when the enableflag indicates that the one or more coding tools are enabled, settingthe application flag to a value indicating that the one or more codingtools are applied; and when the enable flag indicates that the one ormore coding tools are not enabled, decoding the application flag fromthe low level of the bitstream.
 3. The method of claim 1, wherein theacquiring includes: when the enable flag indicates that the one or morecoding tools are enabled, decoding the application flag from the lowlevel of the bitstream; and when the enable flag indicates that the oneor more coding tools are not enabled, setting the application flag to avalue indicating that the one or more coding tools are not applied. 4.The method of claim 1, wherein the enable flag includes: a first enableflag decoded from a sequence parameter set (SPS) level of the bitstream;and a second enable flag decoded from a picture level of the bitstreamwhen the first enable flag indicates that the first coding tool isenabled, wherein, when the second enable flag indicates that the firstcoding tool is enabled, the first application flag is decoded from aslice level of the bitstream.
 5. The method of claim 4, furthercomprising: decoding, from the bitstream, information on second sectionsonto which the mapped luma prediction sample is allowed to belong; andderiving piecewise linear models respectively corresponding to firstsections to which the luma prediction sample is allowed to belong, basedon a bit depth of a current picture containing a current block andinformation on the second sections, wherein the mapped luma predictionsample is derived by determining a first target section to which theluma prediction sample belongs among the first sections, and mapping theluma prediction sample to a mapping section using a piecewise linearmodel corresponding to the first target section, the mapping sectionbeing a section corresponding to the first target section among thesecond sections.
 6. The method of claim 5, wherein each of the piecewiselinear models include a scaling factor indicating a scaling relationshipbetween a number of code words allocated to each of the first sectionsand a number of code words allocated to each of the second sections,wherein the deriving of the piecewise linear models includes: derivingthe number of code words allocated to each of the first sections basedon the bit depth, and deriving the number of code words allocated toeach of the second sections based on the number of code words allocatedto each of the first sections and the information on the secondsections; and deriving the scaling factor based on the number of codewords allocated to each of the first sections and the number of codewords allocated to each of the second sections.
 7. The method of claim5, further comprising: deriving inverse piecewise linear modelsrespectively corresponding to the second sections based on the bit depthand the information on the second sections, wherein the reverse mappingincludes: determining a second target section to which the lumareconstructed sample belongs among the second sections; and deriving anreversely mapped luma reconstructed sample by reversely mapping the lumareconstructed sample to an reverse mapping section using an inversepiecewise linear model corresponding to the second target section, thereverse mapping section being a section corresponding to the secondtarget section among the first sections.
 8. The method of claim 5,further comprising: when the second enable flag indicates that the firstcoding tool is enabled, decoding, from a picture level of the bitstream,a chroma flag indicating whether scaling of chroma residual samples isenabled; and scaling chroma residual samples of the current block basedon chroma scaling information decoded from the bitstream according to avalue of the chroma flag.
 9. The method of claim 8, wherein the scalingof the chroma residual samples includes: deriving chroma scalingrelationships respectively corresponding to the second sections based onthe bit depth, the information on the second sections, and the chromascaling information; determining, among the second sections, a sectionto which an average of luma reconstructed samples positioned on aboveand left sides of the current block; and scaling the chroma residualsamples based on a chroma scaling relationship corresponding to thesection to which the average belongs.
 10. The method of claim 1, whereinthe coding tool further includes a second coding tool configured toapply differential coding to residual samples of the current block,wherein the enable flag is decoded from a sequence parameter set (SPS)level of the bitstream, wherein, when the enable flag indicates that thesecond coding tool is enabled, the application flag includes a secondapplication flag decoded from a block level of the bitstream, the secondapplication flag indicating whether the second coding tool is applied.11. A video decoding apparatus, comprising: an entropy decoderconfigured to decode, from a high level of a bitstream, an enable flagindicating whether one or more coding tools are enabled, the one or morecoding tools including a first coding tool configured to encode a samplevalue using luma component mapping based on a piecewise linear model; anacquisition unit configured to acquire a value of an application flagindicating whether to apply the one or more coding tools, by, accordingto a value of the enable flag, setting the application flag to apredetermined value or decoding the same from a low level of thebitstream, wherein the application flag includes a first applicationflag indicating whether to apply the first coding tool; and an executionunit configured to execute the one or more coding tools when the valueof the application flag is a value indicating that the one or morecoding tools are applied, wherein, when the first coding tool isexecuted according to a value of the first application flag, theexecution unit configured to: generate a mapped luma prediction samplefrom a luma prediction sample based on a piecewise linear modelcorresponding to the luma prediction sample; generate a lumareconstructed sample by adding a luma residual sample reconstructed fromthe bitstream and the mapped luma prediction sample; and reversely mapthe luma reconstructed sample using an inverse piecewise linear modelhaving an inverse relationship with the piecewise linear model.
 12. Theapparatus of claim 11, wherein the acquisition unit is configured to:when the enable flag indicates that the one or more coding tools areenabled, set the application flag to a value indicating that the one ormore coding tools are applied; and when the enable flag indicates thatthe one or more coding tools are not enabled, decode the applicationflag from the low level of the bitstream.
 13. The apparatus of claim 11,wherein the acquisition unit is configured to: when the enable flagindicates that the one or more coding tools are enabled, decode theapplication flag from the low level of the bitstream; and when theenable flag indicates that the one or more coding tools are not enabled,set the application flag to a value indicating that the coding tools areapplied.
 14. The apparatus of claim 11, wherein the enable flagincludes: a first enable flag decoded from a sequence parameter set(SPS) level of the bitstream; and a second enable flag decoded from apicture level of the bitstream when the first enable flag indicates thatthe first coding tool is enabled, wherein, when the second enable flagindicates that the first coding tool is enabled, the first applicationflag is decoded from a slice level of the bitstream.
 15. The apparatusof claim 14, further comprising: a derivation unit configured to derivepiecewise linear models respectively corresponding to first sections towhich the luma prediction sample is allowed to belong, based on a bitdepth of a current picture containing a current block and information onsecond sections, wherein the execution unit includes: a sectiondetermination unit configured to determine a first target section towhich the luma prediction sample belongs among the first sections; and asample derivation unit configured to derive the mapped luma predictionsample by mapping the luma prediction sample to a mapping section usinga piecewise linear model corresponding to the first target section, themapping section being a section corresponding to the first targetsection among the second sections.
 16. The apparatus of claim 15,wherein each of the piecewise linear models includes a scaling factorindicating a scaling relationship between a number of code wordsallocated to each of the first sections and a number of code wordsallocated to each of the second sections, wherein the derivation unitincludes: a first derivation unit configured to derive the number ofcode words allocated to each of the first sections based on the bitdepth; a second derivation unit configured to derive the number of codewords allocated to each of the second sections based on the number ofcode words allocated to each of the first sections and the informationon the second sections; and a factor derivation unit configured toderive the scaling factor based on the number of code words allocated toeach of the first sections and the number of code words allocated toeach of the second sections.
 17. The apparatus of claim 15, wherein, thederivation unit is configured to derive inverse piecewise linear modelsrespectively corresponding to the second sections based on the bit depthand the information on the second sections, wherein the sectiondetermination unit is configured to determine a second target section towhich the luma reconstructed sample belongs among the second sections,and wherein the sample derivation unit is configured to derive areversely mapped luma reconstructed sample by reversely mapping the lumareconstructed sample to an reverse mapping section using an inversepiecewise linear model corresponding to the second target section, thereverse mapping section being a section corresponding to the secondtarget section among the first sections.
 18. The apparatus of claim 5,wherein the entropy decoder is configured to decode, from a picturelevel of the bitstream, a chroma flag indicating whether scaling ofchroma residual samples is enabled when the second enable flag indicatesthat the first coding tool is enabled, and wherein the execution unit isconfigured to scale chroma residual samples of the current block basedon chroma scaling information decoded from the bitstream according to avalue of the chroma flag.
 19. The apparatus of claim 18, wherein thederivation unit is configured to derive chroma scaling relationshipsrespectively corresponding to the second sections based on the bitdepth, the information on the second sections, and the chroma scalinginformation, wherein the section determination unit is configured todetermine, among the second sections, a section to which an average ofluma reconstructed samples positioned on above and left sides of thecurrent block, and wherein the sample derivation unit is configured toscale the chroma residual samples based on a chroma scaling relationshipcorresponding to the section to which the average belongs.
 20. Theapparatus of claim 11, wherein the coding tool further includes a secondcoding tool configured to apply differential coding to residual samplesof the current block, wherein the enable flag is decoded from an SPSlevel of the bitstream, wherein, when the enable flag indicates that thesecond coding tool is enabled, the application flag includes a secondapplication flag decoded from a block level of the bitstream, the secondapplication flag indicating whether the second coding tool is applied.